<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-08-06 21:14:27
 * @LastEditTime: 2020-03-23 14:29:44
 * @LastEditors: Please set LastEditors
 -->
<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0,viewport-fit=cover" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title>Hello APP</title>
	<link rel="stylesheet" type="text/css" href="../css/vant.css">
	<link rel="stylesheet" type="text/css" href="../css/base.css" />
	<link rel="stylesheet" type="text/css" href="../css/local.css" />
	<script type="text/javascript" src="../script/jquery.js"></script>
	<script type="text/javascript" src="../script/masonry.min.js"></script>
	<script type="text/javascript" src="../script/layer/mobile/layer.js"></script>
	<script type="text/javascript" src="../script/vue.min.js"></script>
	<script src="../script/vant.min.js"></script>
	<script type="text/javascript" src="../script/fastclick.js"></script>
	<script type="text/javascript" src="../script/base.js"></script>
	<script type="text/javascript" src="../script/db.js"></script>
	<style type="text/css">
		.head-index {
			/* background-color: #efefef; */
			color: #fff;
			font-weight: 700;
			position: fixed;
			left: 0;
			top: 0;
			width: 100%;
			z-index: 9999;
			transition: all 0.4s;
		}

		.content {
			background: #efefef;
			height: 100%;
			overflow-y: auto;
			-webkit-overflow-scrolling: touch;
		}

		.van-search {
			padding-bottom: 0;
			padding-top: 5px;
			background-color: transparent;
		}

		a {
			text-decoration: none;
			color: #000;
		}

		img {
			width: 100%;
			height: auto;
			display: block;
			border: 0;
		}

		body {
			background: #fff;
			color: #666;
		}

		html,
		body,
		div,
		dl,
		dt,
		dd,
		ol,
		ul,
		li,
		h1,
		h2,
		h3,
		h4,
		h5,
		h6,
		p,
		blockquote,
		pre,
		button,
		fieldset,
		form,
		input,
		legend,
		textarea,
		th,
		td {
			margin: 0;
			padding: 0;
		}

		a {
			text-decoration: none;
			color: #666;
		}

		li {
			list-style: none;
		}

		.divHeight {
			width: 100%;
			height: 10px;
			background: #f5f5f5;
			position: relative;
			overflow: hidden;
		}

		.b-line {
			position: relative;
		}

		.b-line:after {
			content: '';
			position: absolute;
			z-index: 2;
			bottom: 0;
			left: 0;
			width: 100%;
			height: 1px;
			border-bottom: 1px solid #e2e2e2;
			-webkit-transform: scaleY(0.5);
			transform: scaleY(0.5);
			-webkit-transform-origin: 0 100%;
			transform-origin: 0 100%;
		}

		.aui-flex {
			display: -webkit-box;
			display: -webkit-flex;
			display: flex;
			-webkit-box-align: center;
			-webkit-align-items: center;
			align-items: center;
			padding: 15px;
			position: relative;
		}

		.aui-flex-box {
			-webkit-box-flex: 1;
			-webkit-flex: 1;
			flex: 1;
			min-width: 0;
			font-size: 14px;
			color: #333;
		}

		/* 必要布局样式css */

		.icon {
			width: 20px;
			height: 20px;
			display: block;
			border: none;
			float: left;
			background-size: 20px;
			background-repeat: no-repeat;
		}

		.m-slider {
			overflow-x: hidden;
			width: 100%;
			position: relative;
		}

		.slider-wrapper {
			display: -webkit-box;
			display: -webkit-flex;
			display: -ms-flexbox;
			display: flex;
			width: 100%;
			height: 100%;
			-webkit-transform: translate3d(0px, 0px, 0px);
			transform: translate3d(0px, 0px, 0px);
			position: relative;
			z-index: 1;
			-webkit-transition-property: -webkit-transform;
			transition-property: -webkit-transform;
			transition-property: transform;
			transition-property: transform, -webkit-transform;
		}

		.slider-item {
			width: 100%;
			height: 100%;
			-webkit-flex-shrink: 0;
			-ms-flex-negative: 0;
			flex-shrink: 0;
			background: #f6f6f6;
		}

		.slider-item img {
			width: 100%;
			height: auto;
			display: block;
			border: none;
		}



		.aui-palace {
			padding: 0.5rem 0;
			position: relative;
			overflow: hidden;
		}

		.aui-palace-grid {
			position: relative;
			float: left;
			padding: 1px;
			width: 25%;
			box-sizing: border-box;
			margin: 0;
		}

		.aui-palace-grid-icon {
			width: 90px;
			margin: 0 auto;
			padding: 8px;
			border-radius: 100px;
			overflow: hidden;
			margin-top: -20px;
		}

		.aui-palace-grid-icon img {
			display: block;
			width: 100%;
			height: 100%;
			border: none;
		}

		.aui-palace-grid-text {
			display: block;
			text-align: center;
			color: #333;
			font-size: 0.85rem;
			white-space: nowrap;
			text-overflow: ellipsis;
			overflow: hidden;
			padding-top: 0.2rem;
			margin-top: -32px;
		}

		.aui-palace-grid-text h2 {
			font-size: 0.78rem;
			font-weight: normal;
			color: #999999;
		}

		.aui-arrow {
			text-align: right;
			color: #394154;
			padding-right: 12px;
			position: relative;
			font-size: 0.85rem;
		}

		.aui-arrow span {
			color: #999;
			font-size: 0.82rem;
		}

		.aui-arrow:after {
			content: " ";
			display: inline-block;
			height: 7px;
			width: 7px;
			border-width: 2px 2px 0 0;
			border-color: #b2b2b2;
			border-style: solid;
			-webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
			transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
			position: relative;
			top: -2px;
			position: absolute;
			top: 50%;
			margin-top: -5px;
			right: 2px;
			border-radius: 1px;
		}

		.aui-title-time {
			font-weight: normal;
			font-size: 1.1rem;
			color: #e91b4c;
			line-height: 1.4;
			float: left;
		}

		.aui-fleTen {
			padding: 12px 15px;
		}

		.aui-flex-sel {
			padding: 0;
		}

		.aui-flex-sel .aui-flex-box h1 {
			color: #e5063d;
			font-weight: normal;
			font-size: 0.85rem;
			padding-left: 1rem;
			padding-top: 0.5rem;
			width: auto;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			word-wrap: normal;
			word-wrap: break-word;
			word-break: break-all;
		}

		.aui-flex-sel .aui-flex-box p {
			color: #8f8f8f;
			font-size: 0.75rem;
			padding-left: 1rem;
			width: auto;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			word-wrap: normal;
			word-wrap: break-word;
			word-break: break-all;
		}

		.aui-flex-sel .aui-flex-box-one {
			position: relative;
		}

		.aui-flex-sel .aui-flex-box-one:before {
			content: '';
			position: absolute;
			z-index: 0;
			top: 0;
			right: 0;
			height: 100%;
			border-right: 1px solid #D9D9D9;
			-webkit-transform: scaleX(0.5);
			transform: scaleX(0.5);
			-webkit-transform-origin: 100% 0;
			transform-origin: 100% 0;
		}

		.aui-flex-sel .aui-flex-box {
			position: relative;
		}

		.aui-flex-sel .aui-flex-box span {
			position: absolute;
			top: 0;
			right: 0.6rem;
			width: 2.2rem;
			height: 2.2rem;
		}

		.aui-flex-sel-one .aui-flex-box h1 {
			color: #333;
		}

		.aui-flex-sel-one .aui-flex-box img {
			height: 70px;
			width: auto;
			margin: 10px auto;
		}

		.aui-palace-two {
			padding: 0;
		}

		.aui-palace-two .aui-palace-grid {
			width: 50%;
			position: relative;
			margin-bottom: 3px;
		}

		.aui-palace-two .aui-palace-grid .aui-info-text {
			float: left;
			width: 60%;
		}

		.aui-palace-two .aui-palace-grid .aui-info-img {
			float: right;
			width: 40%;
		}

		.aui-palace-two .aui-palace-grid:not(:nth-child(2n)):before {
			content: '';
			position: absolute;
			z-index: 0;
			top: 0;
			right: 0;
			height: 100%;
			border-right: 1px solid #D9D9D9;
			-webkit-transform: scaleX(0.5);
			transform: scaleX(0.5);
			-webkit-transform-origin: 100% 0;
			transform-origin: 100% 0;
		}

		.aui-info-text h2 {
			font-weight: normal;
			font-size: 0.85rem;
			padding-left: 1rem;
			padding-top: 0.5rem;
			width: auto;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			word-wrap: normal;
			word-wrap: break-word;
			word-break: break-all;
			color: #333;
		}

		.aui-info-text p {
			color: #8f8f8f;
			font-size: 0.75rem;
			padding-left: 1rem;
			width: auto;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
			word-wrap: normal;
			word-wrap: break-word;
			word-break: break-all;
		}

		.fl-line {
			position: relative;
			font-size: 1rem;
			padding-left: 0.3rem;
		}

		.fl-line:after {
			content: '';
			position: absolute;
			z-index: 0;
			top: 4px;
			left: 0;
			background: #e03a68;
			width: 3px;
			height: 15px;
			border-radius: 100px;
		}

		.aui-flex-sel-two .aui-flex-box h1 {
			text-align: center;
			padding: 0.4rem 0 0 0;
		}

		.aui-flex-sel-two .aui-flex-box p {
			text-align: center;
			padding: 0;
		}

		.aui-recommend {
			background: #f1f1f1;
		}

		.aui-recommend h2 {
			width: 100%;
			padding: 0.5rem 0;
			font-weight: normal;
			font-size: 0.9rem;
			color: rgba(0, 0, 0, 0.7);
			text-align: center;
		}

		.aui-flex-box span {
			color: #616161;
			font-size: 0.9rem;
		}

		.jp-t {
			text-align: center;
			padding: 5px;
			color: #9e9e9e;
		}

		.jp {
			/* padding: 10px 5px; */
			overflow: hidden;
		}

		.jp-r {
			padding: 5px;
			float: left;
			width: 50%;

		}

		.jp-r>div {
			background: #fff;
			border-radius: 6px;
			overflow: hidden;
		}

		.jp-r img {
			width: 100%;
		}

		.jp-r .n {
			line-height: 20px;
			font-size: 14px;
			color: #000;
			margin: 5px 10px;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 2;
			-webkit-box-orient: vertical;
		}

		.jp-r .p {
			color: #cd1b21;
			font-size: 18px;
			margin: 0 10px 10px;
			background: #fff;
		}

		.mask_a {
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 40px;
			line-height: 40px;
			background: rgba(0, 0, 0, .6);
			z-index: 99;
			color: #fff;
			font-weight: 700;
			text-align: center;
			font-size: 18px;
			letter-spacing: 2px;
		}

		.abc {
			width: 43px !important;
			height: 43px !important;
			margin: 14px auto;
			margin-bottom: 26px;
		}

		.bg {
			background: #efefef;
		}

		.bg .van-search__action i {
			color: #9e9e9e !important;
		}

		.login {
			position: fixed;
			left: 0;
			bottom: 0;
			width: 100%;
		}

		.banner {}
	</style>
</head>

<body>
	<div id="app" v-cloak>
		<div class="init-full">
			<div class="head-index">
				<form action="" class="flex-box">
					<div style="padding: 9px 0 0 15px;" @click="openScan">
						<img id="scan" src="../image/scan-b.png" style="width: 26px;vertical-align: middle;" />
					</div>
					<van-search placeholder="输入编码、品牌、品类、名称搜索" v-model="searchKey" @search="getSearch" shape="round" show-action
						class="flex-main">
						<div slot="action" style="padding: 0 10px;">
							<img id="kf" src="../image/kf-b.png" style="width: 26px;vertical-align: middle;"
								@click="openChat" />
						</div>
					</van-search>
				</form>
			</div>

			<div class="body-no-bottom">
				<van-pull-refresh :disabled="loadingDisabled" v-model="refreshLoading" @refresh="onRefresh">
					<div class="content" onScroll="scrollMove()">

						<div>

							<van-swipe :autoplay="3000" indicator-color="white" :stop-propagation="false">
								<van-swipe-item v-for="row in activityBanner" @click="openUrl(row)">
									<div>
										<div :style="{height:getBannerHeight()}">
											<img :src="row.Pic_Path">
										</div>
									</div>
								</van-swipe-item>
							</van-swipe>

						</div>

						<div class="aui-palace b-line" style="background: #fff;">
							<a href="javascript:;" class="aui-palace-grid" v-for="row in typeList"
								v-show="row.ParentCategoryId == 0" @click="intoType(row)">
								<div class="aui-palace-grid-icon">
									<img :src="row.Icon" alt="">
								</div>
								<div class="aui-palace-grid-text">
									<h2>{{row.Name}}</h2>
								</div>
							</a>

						</div>
						<div>
							<!-- <div class="jp-t">精品推荐</div> -->
							<div>
								<div class="aui-flex aui-fleTen b-line">
									<div class="aui-flex-box">
										<h2 class="aui-title-time fl-line">热销商品</h2>
									</div>
								</div>
							</div>
							<div class="jp">
								<div class="jp-r" v-for="row in hostList" @click="intoDetail(row)">
									<div>
										<div>
											<img :src="row.ThumbnailUrl410" />
										</div>
										<div class="n">{{row.ProductName}}</div>
										<div class="p">
											<span style="font-size: 12px;" v-if="userInfo">￥</span><span
												v-if="userInfo">{{row.SalePrice}}</span>
											<span style="font-size: 12px;color: #9e9e9e;">{{row.VistiCounts}}人浏览过</span>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div>
							<div>
								<div class="aui-flex aui-fleTen b-line">
									<div class="aui-flex-box">
										<h2 class="aui-title-time fl-line">套餐专区</h2>
									</div>
								</div>
								<div style="padding: 0 10px 10px;" @click="openWinPage('setMeal')">
									<div style="position: relative;border-radius: 6px;overflow: hidden;">
										<img src="../image/banner-2.jpg" />
									</div>
								</div>

							</div>


							<!-- <div class="divHeight b-line"></div> -->
							<div>
								<div class="aui-flex aui-fleTen b-line">
									<div class="aui-flex-box">
										<h2 class="aui-title-time fl-line">品牌优购</h2>
									</div>
								</div>
								<div class="aui-flex b-line" style="padding:0 10px;">
									<div class="aui-flex-box">
										<img src="../image/pp.png" alt="">
									</div>
								</div>
								<div style="padding: 0 10px;">
									<van-grid :column-num="3">
										<van-grid-item v-for="(row,index) in brandList" @click="intoList(row)"
											v-if="index != 5">
											<div>
												<div><img style="width: 90%;;margin: 0 auto;" :src="row.Logo" />
												</div>
											</div>
										</van-grid-item>
									</van-grid>
								</div>
							</div>
							<div>
								<!-- <div class="jp-t">精品推荐</div> -->
								<van-divider :style="{borderColor: '#c4c4c5'}">精品推荐</van-divider>
								<div class="jp">
									<div class="jp-r" v-for="row in boutiqueList" @click="intoDetail(row)">
										<div>
											<div>
												<img :src="row.ThumbnailUrl410" />
											</div>
											<div class="n">{{row.ProductName}}</div>
											<div class="p">
												<span style="font-size: 12px;" v-if="userInfo">￥</span><span
													v-if="userInfo">{{row.SalePrice}}</span>
												<span
													style="font-size: 12px;color: #9e9e9e;">{{row.VistiCounts}}人浏览过</span>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>


					</div>
				</van-pull-refresh>
			</div>

		</div>
		<div class="login">
			<van-notice-bar v-if="!userInfo" wrapable :scrollable="false" background="rgba(255, 251, 232, 0.8)"
				@click="loginAPP">您还未登录,请登录后查看更多内容</van-notice-bar>
		</div>
	</div>
</body>
<script type="text/javascript">
	var vm;

	function scrollMove() {
		if ($('.content').scrollTop() > 20) {
			$('.head-index').addClass('bg');
			$('#kf').attr('src', '../image/kf-h.png');
			$('#scan').attr('src', '../image/scan-h.png');
		} else {
			$('.head-index').removeClass('bg')
			$('#kf').attr('src', '../image/kf-b.png');
			$('#scan').attr('src', '../image/scan-b.png');
		}
	}

	apiready = function () {
		//$('.init-full').show();

		var FNScanner = api.require('FNScanner');

		api.addEventListener({
			name: 'refreshAboutUser'
		}, function (ret, err) {
			vm.userInfo = FLD.getUserInfo();
		});

		api.addEventListener({
			name: 'loginOut'
		}, function (ret, err) {
			vm.userInfo = '';

		});

		api.addEventListener({
			name: 'clearLoginInfo'
		}, function (ret, err) {
			vm.userInfo = '';
		});

		Vue.use(vant.Lazyload, {
			loading: '../image/no.png',
			error: '../image/no.png'
		});







		vm = new Vue({
			el: '#app',
			data: {
				showLoading: false,
				loadingDisabled: false,
				refreshLoading: false,
				userInfo: FLD.getUserInfo() || '',
				serverIP: 'http://' + FLD.serverIP,
				shoppingMallServerIP: 'http://' + FLD.shoppingMallServerIP,
				searchKey: '',
				city: [],
				location: [],
				activityBanner: [],
				typeList: [],
				hostList: [],
				boutiqueList: [],
				brandList: []
			},
			created: function () {
				var that = this;

				var appTop = parseInt(window.localStorage.getItem('safeAreaTop'));

				if (appTop) {
					$('.head-index').css({
						'padding-top': appTop + 'px',
						'height': appTop + 50 + 'px',
						'line-height': '40px'
					})
				}

				if (FLD.getUserInfo()) {
					that.getNewUserData();
				}


				//获取轮播
				that.getActivityRole();
				//商品分类
				that.getTypes();
				//精品
				that.getBoutique();
				//热销
				that.getSellWell();
				//品牌
				that.getStBrand();


			},
			methods: {
				openScan() {
					FNScanner.open({
						autorotation: true
					}, function (ret, err) {
						if (ret) {
							if (ret.eventType == 'success') {
								var obj = {
									S_Type: 60,
									S_Cont: '',
									S_BranchID: 0,
									S_SXZ: '',
									S_StockID: 0,
									S_CargoID: 0,
									S_BarCode: ret.content,
									S_PriceN: 0,
									S_ProductID: 0
								}
								FLD.ajax('AP_BasList', obj, function (res) {
									if (res.ds.length == 0) {
										layer.open({
											content: '当前二维码未查询到商品!',
											skin: 'msg',
											time: 2
										});
										return false;
									}
									var reg = /[\u4e00-\u9fa5]/g; 
									var name = res.ds[0].name.replace(/-/g, '').replace(reg, '');
									var obj = {
										keyName: name,
										parentCategoryId1: 0,
										parentCategoryId2: 0,
										categoryId: 0,
										brandId: 0,
										tagId: 0,
										pageIndex: 1,
										pageSize: 20
									}
									FLD.ajax('sp_searchProducts', obj, function (res) {
										if (res.ds.length) {
											api.openWin({
												name: 'product',
												url: 'product.html',
												reload: true,
												slidBackEnabled: false,
												pageParam: {
													productData: res.ds[0],
													stepIndex: 1
												}
											})
										} else {
											layer.open({
												content: '当前二维码未查询到商品!',
												skin: 'msg',
												time: 2
											});
										}
									})

								})
							}
						} else {
							layer.open({
								content: '扫描失败!',
								skin: 'msg',
								time: 2
							});

						}
					});
				},
				openChat() {
					var that = this;
					api.sendEvent({
						name: 'openChat'
					});
				},
				onRefresh() {
					var that = this;
					that.refreshLoading = true;
					//获取轮播
					that.getActivityRole();
					//商品分类
					that.getTypes();
					//精品
					that.getBoutique();
					//热销
					that.getSellWell();
					//品牌
					that.getStBrand();
				},
				getBannerHeight() {
					var that = this;
					return api.winWidth * 0.54 + 'px'
				},
				getNewUserData() {
					var that = this;
					FLD.ajax('sp_getMemberInfo', {}, function (res) {
						that.userInfo = res.ds[0];
						window.localStorage.setItem('userInfo', JSON.stringify(res.ds[0]));

					})
				},
				getStBrand() {
					var that = this;
					FLD.ajax('sp_getBrand', {}, function (res) {
						var brandList = res.ds;
						var repeatImageCache = function (x) {
							if (x == brandList.length) {
								that.brandList = brandList;
								return false;
							} else {
								api.imageCache({
									url: that.shoppingMallServerIP + brandList[x].Logo,
									thumbnail: false
								}, function (ret, err) {
									var url = ret.url;
									brandList[x].Logo = url;
									x++;
									repeatImageCache(x)
								});

							}
						}
						repeatImageCache(0);
					})
				},
				getActivityRole() {
					var that = this;
					FLD.ajax('sp_getAdList', { RegType: '首页顶部' }, function (res) {
						setTimeout(function () {
							that.refreshLoading = false;
						}, 1000)

						var activityBanner = res.ds;
						var repeatImageCache = function (x) {
							if (x == activityBanner.length) {
								that.activityBanner = activityBanner;
								return false;
							} else {
								api.imageCache({
									url: that.shoppingMallServerIP + activityBanner[x].Pic_Path,
									thumbnail: false
								}, function (ret, err) {
									var url = ret.url;
									activityBanner[x].Pic_Path = url;
									x++;
									repeatImageCache(x)
								});

							}
						}
						repeatImageCache(0);
					})
				},
				getTypes() {
					var that = this;
					FLD.ajax('sp_allProductType', {}, function (res) {
						var typeList = res.ds;
						var repeatImageCache = function (x) {
							if (x == typeList.length) {
								that.typeList = typeList;
								return false;
							} else {
								if (typeList[x].ParentCategoryId == 0) {
									api.imageCache({
										url: that.shoppingMallServerIP + typeList[x].Icon,
										thumbnail: false
									}, function (ret, err) {
										var url = ret.url;
										typeList[x].Icon = url;
										x++;
										repeatImageCache(x)
									});
								} else {
									x++;
									repeatImageCache(x)
								}

							}
						}
						repeatImageCache(0);
					})
				},
				getSellWell() {
					var that = this;
					FLD.ajax('sp_getRecomProduct', { Type: '热销' }, function (res) {
						var hostList = res.ds;
						var repeatImageCache = function (x) {
							if (x == hostList.length) {
								that.hostList = hostList;
								that.$nextTick(function () {
									$('.jp-1 img').load(function () {
										$('.jp').masonry({
											itemSelector: '.jp-r',
											isAnimated: true
										});
									})

								})
								return false;
							} else {
								api.imageCache({
									url: that.shoppingMallServerIP + hostList[x].ThumbnailUrl410,
									thumbnail: false
								}, function (ret, err) {
									var url = ret.url;
									hostList[x].ThumbnailUrl410 = url;
									x++;
									repeatImageCache(x)
								});

							}
						}
						repeatImageCache(0);

					})
				},
				getBoutique() {
					var that = this;
					FLD.ajax('sp_getRecomProduct', { Type: '精品' }, function (res) {
						var boutiqueList = res.ds;
						var repeatImageCache = function (x) {
							if (x == boutiqueList.length) {
								that.boutiqueList = boutiqueList;
								that.$nextTick(function () {
									$('.jp img').load(function () {
										$('.jp').masonry({
											itemSelector: '.jp-r',
											isAnimated: true
										});
									})

								})
								return false;
							} else {
								api.imageCache({
									url: that.shoppingMallServerIP + boutiqueList[x].ThumbnailUrl410,
									thumbnail: false
								}, function (ret, err) {
									var url = ret.url;
									boutiqueList[x].ThumbnailUrl410 = url;
									x++;
									repeatImageCache(x)
								});

							}
						}
						repeatImageCache(0);
					})
				},
				intoList(row) {
					var that = this;

					api.openWin({
						name: 'productList',
						url: 'productList.html',
						reload: true,
						slidBackEnabled: false,
						pageParam: {
							brandId: row.BrandId
						}
					})

				},
				getSearch() {
					var that = this;
					api.openWin({
						name: 'productList',
						url: 'productList.html',
						reload: true,
						slidBackEnabled: false,
						pageParam: {
							searchKey: that.searchKey
						}
					})
				},
				intoDetail(row) {
					var that = this;
					api.openWin({
						name: 'product',
						url: 'product.html',
						reload: true,
						slidBackEnabled: false,
						pageParam: {
							productData: row,
							stepIndex: 1
						}
					})
				},
				intoType(row) {
					var that = this;

					var detailTypeList = that.typeList.filter(function (item) {
						return item.ParentCategoryId == row.CategoryId;
					})
					for (var i in detailTypeList) {
						var node = [];
						for (var j in that.typeList) {
							if (detailTypeList[i].CategoryId == that.typeList[j].ParentCategoryId) {
								node.push(that.typeList[j])
							}
						}
						detailTypeList[i].typeNode = node;
					}
					api.openWin({
						name: 'channel',
						url: 'channel.html',
						reload: true,
						slidBackEnabled: false,
						pageParam: {
							detailTypeList: detailTypeList
						}
					})
				},
				openUrl(row) {
					var that = this;
					if (row.AdLink && row.AdLink.indexOf('http') > -1) {
						api.openWin({
							name: 'activityView',
							url: 'activityView.html',
							reload: true,
							slidBackEnabled: false,
							pageParam: {
								url: row.AdLink
							}
						})
					}
				},
				loginAPP() {
					api.openWin({
						name: 'login',
						url: '../login.html',
						animation: {
							type: "movein",                //动画类型（详见动画类型常量）
							subType: "from_bottom",       //动画子类型（详见动画子类型常量）
							duration: 300                //动画过渡时间，默认300毫秒
						},
						reload: true,
						slidBackEnabled: false
					})
				},

				openWinPage(url) {
					var that = this;
					api.openWin({
						name: url,
						url: url + '.html',
						reload: true,
						slidBackEnabled: false
					})

				}
			}
		})
	};
</script>

</html>